<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>订单发货</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="{__STATIC__}/layuiAdmin/layui/css/layui.css" rel="stylesheet">
    <link href="{__STATIC__}/layuiAdmin/adminui/dist/css/admin.css" rel="stylesheet">
    <link href="{__STATIC__}/layuiAdmin/style/style.css" rel="stylesheet">
    <style>
        html {background: #fff;padding-top: 20px;}
    </style>
</head>
<body>
    <div class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">选择类型：</label>
            <div class="layui-input-inline">
                <input type="radio" name="m_type" value="1" lay-filter="type" title="发货" {eq name="$data.express_type" value="1"}checked{/eq}>
                <input type="radio" name="m_type" value="2" lay-filter="type" title="无需配送" {eq name="$data.express_type" value="2"}checked{/eq}>
            </div>
        </div>
        <div id="span_express1" {eq name="$data.express_type" value="2"}style="display: none;"{/eq}>
        <div class="layui-form-item">
            <label class="layui-form-label">快递公司：</label>
            <div class="layui-input-inline">
                <select name="m_express_title">
                    {volist name="$expressList" id="vo"}
                    <option value="{$vo.name}" {eq name="$data.express_title" value="$vo.name"}selected{/eq}>{$vo.name}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">运单号：</label>
            <div class="layui-input-inline">
                <input type="text" name="m_express_sn" value="{$data.express_sn}" class="layui-input">
            </div>
        </div>
        </div>
        <div class="layui-form-item" id="span_express2" {eq name="$data.express_type" value="1"}style="display: none;"{/eq}>
            <label class="layui-form-label">备注：</label>
            <div class="layui-input-inline">
                <input type="text" name="m_express_info" value="{$data.express_info}" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">收货信息：</label>
            <div class="layui-form-mid layui-word-aux" style="width: 320px;">
                {$data.name}，{$data.tel}<br>
                {$data.address}
            </div>
        </div>
        <input type="hidden" name="m_id" value="{$data.id}">
        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-submit" id="LAY-submit" value="确认">
        </div>
    </div>
</body>
</html>
<script src="{__STATIC__}/layuiAdmin/layui/layui.js"></script>
<script>
    layui.use(function(){
        let $ = layui.$;
        let form = layui.form;

        /* 监听radio */
        form.on('radio(type)',function (data) {
            if(data.value==1){
                $("#span_express1").show();
                $("#span_express2").hide();
            }
            else {
                $("#span_express1").hide();
                $("#span_express2").show();
            }
        });
    });
</script>